package edu.zju.gis.dbfg.model.statistic;
import lombok.Getter;
import lombok.Setter;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.Serializable;

@Getter
@Setter
public class LUContrastStatisticArgs implements Serializable{
    private final static Logger logger = LoggerFactory.getLogger(ContrastStatisticArgs.class);

    @Option(name = "-output",usage = "输出文件路径", required = true)
    private String output;

    @Option(name = "-input1",usage = "输入数据,extent", required = true)
    private String input1;

    @Option(name = "-type1",usage = "输入数据类型,extent", required = true)
    private String type1;

//    @Option(name = "-idIndex1",usage = "输入数据类型,extent", required = true)
//    private String idIndex1;

    @Option(name = "-input2",usage = "目标数据1,target1", required = true)
    private String input2;

    @Option(name = "-type2",usage = "数据类型,target1", required = true)
    private String type2;

    @Option(name = "-dlbmIndex2",usage = "分类字段(dlbm),target1")
    private String dlbmIndex2="DLBM";

    @Option(name = "-zldwdmIndex2",usage = "行政区划字段,target1")
    private String zldwdmIndex2="ZLDWDM";

    @Option(name = "-areaIndex2",usage = "面积字段(TBMJ),target1")
    private String areaIndex2="TBMJ";

    @Option(name = "-jareaIndex2",usage = "净面积字段(TBDLMJ),target1")
    private String jareaIndex2="TBDLMJ";

    @Option(name = "-kcdlbmIndex2",usage = "扣除部分分类字段(kcdlbm),target1")
    private String kcdlbmIndex2="KCDLBM";

    @Option(name = "-input3",usage = "目标数据2,target2", required = true)
    private String input3;

    @Option(name = "-type3",usage = "数据类型,target2", required = true)
    private String type3;

    @Option(name = "-dlbmIndex3",usage = "分类字段(dlbm),target3")
    private String dlbmIndex3="CZCLX";

    @Option(name = "-zldwdmIndex3",usage = "行政区划字段,target3")
    private String zldwdmIndex3="CZCDM";

    @Option(name = "-areaIndex3",usage = "面积字段,target3")
    private String areaIndex3="CZCMJ";

    @Option(name = "-crs1",usage = "extent crs")
    private String crs1 = "4326";

    @Option(name = "-crs2",usage = "target1 crs")
    private String crs2 = "4326";

    @Option(name = "-crs3",usage = "target2 crs")
    private String crs3 = "4326";

    @Option(name = "-parallelize", usage="parallelize num")
    private int partitionNum = 4;

    public  static LUContrastStatisticArgs initArgs(String args[]){
        LUContrastStatisticArgs mArgs = new LUContrastStatisticArgs();
        CmdLineParser parser = new CmdLineParser(mArgs);
        try {
            parser.parseArgument(args);
            return mArgs;
        } catch (CmdLineException e) {
            logger.error(e.getLocalizedMessage());
            return null;
        }
    }
}
